<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="vue.js"></script>
    <style>
        /* vue只有这两个状态
            因为它只有v-if
            和v-show
        */
        /*隐藏到显示*/
        .fade-enter,
        .fade-leave-to{
            opacity: 0;
        }

        .fade-enter-to,
        .fade-leave{
            opacity: 1;
        }

        .fade-enter-active,
        .fade-leave-active{
            transition: opacity 1s;
        }



    </style>
</head>
<body>
    <div id="app">
        <transition name="fade">
            <div v-if="show">hello</div>
        </transition>
        <button @click="handelClick">show</button>
    </div>
</body>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            show:true
        },
        methods:{
            handelClick:function () {
                this.show = !this.show
            }
        }
    })
</script>
</html>
